<template>
<div class="shareSheet">
  <van-share-sheet
      v-model="showShare"
      title="立即分享给好友"
      :options="options"
      @select="select"
  />
</div>
</template>

<script>
import Vue from 'vue';
import { ShareSheet,Toast } from 'vant';

Vue.use(ShareSheet);
Vue.use(Toast)
export default {
name: "shareSheet",
  data() {
    return {
      showShare: false,
      options: [
        [
          { name: '微信', icon: 'wechat' },
          { name: '微博', icon: 'weibo' },
          { name: 'QQ', icon: 'qq' },
        ],
        [
          { name: '复制链接', icon: 'link' },
          { name: '分享海报', icon: 'poster' },
          { name: '二维码', icon: 'qrcode' },
          { name: '小程序码', icon: 'weapp-qrcode' },
        ],
      ],
    };
  },
  methods:{
    select(option){
      Toast(option.name)
      this.showShare=false
    }
  }
}
</script>

<style scoped>

</style>